package ui.activity.login;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import base.activity.BaseLayoutActivity;
import com.dispatchapp.andlei.R;
import com.just.agentweb.AgentWeb;
import com.just.agentweb.AgentWebView;


public class ServiceAgreementActivity extends BaseLayoutActivity {
    private AgentWeb mAgentWeb;
    private AgentWebView agentWebView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle("同学快跑");
        setTitleBg(R.color.white);
//        hideBack();
    }
    @Override
    protected int getLayoutId() {
        return R.layout.activity_service_agreement;
    }
    @Override
    protected void findViews() {
        agentWebView = getView(R.id.AgentWebView);
    }
    @Override
    protected void formatViews() {
    }
    @Override
    protected void formatData() {
        loadData();
    }
    private void loadData(){
        //1服务协议 2积分规则 3关于我们
       // String url = "https://github.com/Justson/AgentWeb    http://www.jd.com";
        String url = "https://dispatch.birdback.org/rider/user/agreement";
        mAgentWeb = AgentWeb.with(ServiceAgreementActivity.this)
                .setAgentWebParent(agentWebView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT))
                .useDefaultIndicator()
                .createAgentWeb()
                .ready()
                .go(url);
    }
    private WebViewClient mWebViewClient=new WebViewClient(){
        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            //do you  work
        }
    };
    private WebChromeClient mWebChromeClient=new WebChromeClient(){
        @Override
        public void onProgressChanged(WebView view, int newProgress) {
            //do you work
        }
    };
    @Override
    protected void getBundle(Bundle bundle) {

    }

    @Override
    public void onClick(View v) {

    }
}
